#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.shortcuts import *
from django.http import *
from researchSNS.SNS.models import *
from researchSNS.Group.models import *
from researchSNS.QA.models import *

POSTS_PER_PAGE =  20
FLOORS = ('沙发', '板凳', '地毯', '地板', '地下室', '地基', '地壳', '地幔', '地核') 

def get_group_by_id(group_id):
    try:
        group = Group.objects.get(id = group_id)
        return group
    except:
        return None
    
def get_group_by_domainname(group_domainname):
    try:
        group = Group.objects.get(domainname_suffix = group_domainname)
        return group
    except:
        return None
